package unm.excel

class CatalogExcel extends AbstractExcel {
    String type
    String chineseName
    String englishName

    static List<CatalogExcel> load() {
        def sheet = getSheet('catalog_data.xls', 'catalog')
        def lastRowNum = sheet.getLastRowNum() // begin at 0

        def list = []
        for (int i = 1; i <= lastRowNum; i++) {
            def row = sheet.getRow(i)
            def type = row.getCell(0)?.stringCellValue
            def chineseName = row.getCell(1)?.stringCellValue
            def englishName = row.getCell(2)?.stringCellValue
            list << new CatalogExcel(type: type, chineseName: chineseName, englishName: englishName)
        }
        return list
    }
}
